package com.lcf.system.app.service.impl;

import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lcf.system.app.service.SysDictAppService;
import com.lcf.system.app.vo.dict.SysDictAppVO;
import com.lcf.system.dao.SysDictDao;
import com.lcf.framework.model.system.SysDict;
import com.lcf.framework.enums.SysDictStatusEnum;
import com.lcf.system.app.query.SysDictAppQuery;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 字段值(SysDict)表服务实现类
 *
 * @author lcf
 * @since 2025-03-16 22:04:24
 */
@Service("sysDictAppService")
public class SysDictAppServiceImpl extends ServiceImpl<SysDictDao, SysDict> implements SysDictAppService {

    @Override
    public List<SysDictAppVO> list(SysDictAppQuery query) {
        List<SysDict> list = lambdaQuery()
                .eq(SysDict::getTypeId, query.getTypeCode())
                .eq(SysDict::getStatus, SysDictStatusEnum.ENABLE)
                .list();

        return BeanUtil.copyToList(list, SysDictAppVO.class);
    }
}

